package com.mall.sun.controller;

import com.mall.sun.model.vo.ResultVO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:  <br>
 * date: 2021/7/24 13:28 <br>
 * author: ztz <br>
 * version: 1.0 <br>
 */
@RestController
@RequestMapping("/error")
public class ErrorController {
    @RequestMapping("/400")
    public ResultVO error400(){
        return new ResultVO("error",400,"客户端请求的语法错误，服务器无法理解");
    }
    @RequestMapping("/401")
    public ResultVO error401(){
        return new ResultVO("error",401,"请求要求用户的身份认证");
    }
    @RequestMapping("/403")
    public ResultVO error403(){
        return new ResultVO("error",403,"身份权限不足");
    }
    @RequestMapping("/404")
    public ResultVO error404(){
        return new ResultVO("error",404,"无法找到请求的资源");
    }
    @RequestMapping("/415")
    public ResultVO error415(){
        return new ResultVO("error",415,"服务器无法处理请求附带的媒体格式");
    }
    @RequestMapping("/500")
    public ResultVO error500(){
        return new ResultVO("error",500,"服务器内部错误，无法完成请求");
    }
}
